<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>冷库温湿度趋势分析</title>
    <!-- 使用CDN引入CSS -->
    <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.6.0/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/font-awesome/5.15.3/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/bootstrap-datepicker/1.9.0/css/bootstrap-datepicker.min.css">
    <style>
        .card {
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            margin-bottom: 20px;
        }
        .card-header {
            background-color: #f8f9fa;
            border-bottom: 1px solid #e9ecef;
            padding: 15px 20px;
            border-top-left-radius: 8px;
            border-top-right-radius: 8px;
        }
        .card-body {
            padding: 20px;
        }
        .form-label {
            font-weight: bold;
        }
        .chart-container {
            height: 400px;
            margin-bottom: 20px;
        }
    </style>
</head>
<body>
    <div class="container-fluid">
        <h2 class="mt-4 mb-4">冷库温湿度趋势分析</h2>
        
        <div class="card mb-4">
            <div class="card-header">
                <i class="fas fa-search mr-1"></i>查询条件
            </div>
            <div class="card-body">
                <div class="row mb-4">
                    <div class="col-md-3">
                        <div class="form-group">
                            <label for="warehouseSelect">仓库</label>
                            <select id="warehouseSelect" class="form-control">
                                <option value="">选择仓库</option>
                            </select>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="form-group">
                            <label for="storageAreaSelect">冷库区域</label>
                            <select id="storageAreaSelect" class="form-control">
                                <option value="">全部区域</option>
                            </select>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="form-group">
                            <label for="deviceIdSelect">设备ID</label>
                            <select id="deviceIdSelect" class="form-control">
                                <option value="">全部设备</option>
                            </select>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="form-group">
                            <label for="aggregateTypeSelect">聚合方式</label>
                            <select id="aggregateTypeSelect" class="form-control">
                                <option value="hour">按小时</option>
                                <option value="day">按天</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="row mb-4">
                    <div class="col-md-3">
                        <div class="form-group">
                            <label for="startDateInput">开始时间</label>
                            <input type="text" class="form-control datepicker" id="startDateInput" placeholder="选择开始时间">
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="form-group">
                            <label for="endDateInput">结束时间</label>
                            <input type="text" class="form-control datepicker" id="endDateInput" placeholder="选择结束时间">
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="form-group">
                            <label>&nbsp;</label>
                            <button type="button" class="btn btn-primary btn-block" id="searchBtn">
                                <i class="fas fa-search"></i> 查询
                            </button>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="form-group">
                            <label>&nbsp;</label>
                            <button type="button" class="btn btn-secondary btn-block" id="resetBtn">
                                <i class="fas fa-redo"></i> 重置
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 温度趋势图 -->
        <div class="card mb-4">
            <div class="card-header">
                <i class="fas fa-chart-line mr-1"></i>温度趋势
            </div>
            <div class="card-body">
                <div id="temperatureChart" class="chart-container"></div>
            </div>
        </div>
        
        <!-- 湿度趋势图 -->
        <div class="card mb-4">
            <div class="card-header">
                <i class="fas fa-chart-line mr-1"></i>湿度趋势
            </div>
            <div class="card-body">
                <div id="humidityChart" class="chart-container"></div>
            </div>
        </div>
        
        <!-- 温湿度异常统计 -->
        <div class="card mb-4">
            <div class="card-header">
                <i class="fas fa-exclamation-triangle mr-1"></i>异常统计
            </div>
            <div class="card-body">
                <div id="abnormalChart" class="chart-container"></div>
            </div>
        </div>
    </div>

    <!-- 使用CDN引入JS -->
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/popper.js/1.16.1/umd/popper.min.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.6.0/js/bootstrap.bundle.min.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/bootstrap-datepicker/1.9.0/js/bootstrap-datepicker.min.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/echarts/5.3.3/echarts.min.js"></script>
    <script th:src="@{/js/warehouse/coldStorageTrend.js}"></script>
</body>
</html> 